package org.eliza.base.basicx.functionx

private fun basic() {
    var ok: String? = "ok"

    val let = ok?.let {
        println("let ${it}")
        it.plus("1")
        it.length
    } ?: -1
    println("let ${let}")

    val also = ok?.also {
        it.plus("2")
        println("also ${it}")
    } ?: "-1"
    println("also ${also}")


    val run = ok?.run {
        this.plus("3") //真实修改
        plus("3") //真实修改
    } ?: "-1"
    println("run ${run}")

    val with = with(ok) {
        println("length ${this?.length}")
    } ?: "-1"
    println("with ${with}")


}

private  fun main() {

    basic()
}